<template>
  <div id="wrapper" style="height:100%;">
    <!-- top -->
    <!-- <div class="top-header border-bottom">
         <div class="top-back"><a href="/vue/memberseller"></a></div>
         <h2 class="f36 ">我是卖家</h2>
         <div class="top-right"><a class="back-home" href="/"></a></div>
     </div> -->
    <div style="margin-top: 2.03rem"></div>
    <div class="sellnage-nav tab mt-97 fixed-top border20-bottom">
      <ul class="tab-nav">
        <li class="fl border-bottom f30" :class="{'active':params.status == 0}" @click="selectStatus(0)">
          <a class="nav-01">审核中</a>
        </li>
        <li class="fl border-bottom f30" :class="{'active':params.status == 1}" @click="selectStatus(1)">
          <a class="nav-02">在售中</a>
        </li>
        <li class="fl border-bottom f30" :class="{'active':params.status == 4}" @click="selectStatus(4)">
          <a class="nav-03">已售出</a>
        </li>
        <li class="fl border-bottom f30" :class="{'active':params.status == 2}" @click="selectStatus(2)">
          <a class="nav-04">已下架</a>
        </li>
      </ul>
    </div>
    <div class="sellmanage-main">

      <!--审核中-->
      <div class="seller-01 " ref="tab">
        <div class="sellnage-connt mb-20" v-for="v in mobileList">
          <div v-if=v.goodsEO>
          <div class="manage-caption px-30  bg-fff">
            <div class="manage-titl py-30 f28">
						<span v-if="v.goodsEO.propertyValuesTitle" class=" fl mr-30 fontbold">
								{{v.goodsEO.propertyValuesTitle}}
						</span>
              <span class=" fl mr-30 fontbold" v-else>
                            <!-- <em v-if="v.goodsPropertyEOList.length > 0">
                            【<em :class="{'ml8':index != 0}" v-for="(entity,index) in v.goodsPropertyEOList">
                             {{entity.attributeVal}}</em>】
                            </em> -->
                        {{v.goodsEO.title}}
                        </span>
            </div>
            <!-- <router-link :to="{name:'accountDetail',
            params:{goodsId:v.goodsEO.goodsId,goods_source_type:0,gameType:v.goodsEO.gameType}}"
            @click.native="saveSrollTop()"> -->
            <a @click="goToDetail(v.goodsEO)">
              <div class="manage-contn bg-faf">
                <div class="mancon-img fl">
                  <i class="f22 color-fff bg-000">
                    {{v.goodsEO.goodsType | getGoodsTypeText}}
                  </i>
                  <span class="middle"></span>
                  <img src="~images/default_img.jpg" v-if="!v.goodsEO.goodsImg">
                    <img :src="v.goodsEO.goodsImg" v-if="v.goodsEO.goodsImg" :onerror="errorImg">
                </div>
                <div class="mancon-tn py-15">
                  <div class="tn-hxtxt f26 color-666">
                    {{v.goodsEO.gameName}}/{{v.goodsEO.regionName}}/{{v.goodsEO.serverName}}
                  </div>
                  <div class="tn-hxtxt f26 color-666 " v-if="v.goodsEO.goodsType==3 && v.goodsEO.gameType==1">商品单价：{{v.goodsEO.price}}元</div>
                  <div class="tn-hxtxt f26 color-666 " v-if="v.goodsEO.goodsType==3 && v.goodsEO.gameType==2">商品价格：{{v.goodsEO.price}}元/件</div>
                  <div class="tn-hxtxt f26 color-666 " v-if="v.goodsEO.goodsType!=3">商品价格：{{v.goodsEO.price}}元</div>
                    <div class="tn-hxtxt f26 color-666" v-if="params.status != 2">发布时间：{{v.goodsEO.createTime.time | format}}
                  </div>

                    <div class="tn-hxtxt f26 color-666" v-if="params.status == 2">下架时间：{{v.goodsEO.lastUpdateTime.time | format}}</div>
                </div>
              </div>
            </a>
            <!-- </router-link> -->
          </div>
          <div class="mancon-titl px-30 py-30 bg-fff border-bottom ">
                	<span class="title-curent f30 pl-30 color-000 buyct-why">{{v.goodsEO.auditorStatus | getStatusText}}
                    <em class="color-m1">{{v.goodsEO.auditorStatus | getReason(params.status, v.goodsEO)}}</em>
                    </span>
          </div>

          <div class="mancon-btn pr-20 py-20 bg-fff border-bottom " v-if="!(v.goodsEO.gameType ===2 && v.goodsEO.goodsType == 3 && params.status == 4)">
            <a class="f30 color-666 border"
               v-if="v.goodsEO.goodsType === 2 &&  params.status != 0 && (params.status == 1 & v.goodsEO.isOnline)"
               @click="shareClick(v)">分享</a>

            <router-link class="f30 color-666 border" @click.native="saveSrollTop()"
                         :to="{name:'EditAccountGoods',
                    query:{goodsId:v.goodsEO.goodsId,
                           gameId:v.goodsEO.gameId,goodsType:v.goodsEO.goodsType
                           }}"
                         v-if="params.status == 1 && v.goodsEO.goodsType === 2 && v.goodsEO.isOnline ">修改
            </router-link>

            <span
               v-if="v.goodsEO.gameType ===2 && v.goodsEO.goodsType == 3 && Number(params.status) === 1"
               class="kucun pl-30 color-000 f30 fl" style="line-height: .7rem">剩余库存：<span class="color-m1 fontarial">{{v.goodsEO.blanceNum}}</span></span>

            <!--金币编辑跳转-->
            <a class="f30 color-666 border" @click="goToConins(v.goodsEO)"
               v-if="params.status == 1 && v.goodsEO.goodsType === 3">编辑</a>

            <!--手游金币编辑上架跳转-->
            <a class="f30 color-666 border" @click="goToConins(v.goodsEO)"
               v-if="params.status == 2 && v.goodsEO.goodsType === 3 && v.goodsEO.gameType === 2 ">编辑上架</a>

            <!--手游金币删除-->
            <a class="f30 color-666 border" @click="deleteGoods(v.goodsEO.goodsId)"
               v-if="params.status == 2 && v.goodsEO.goodsType === 3 && v.goodsEO.gameType === 2">删除</a>

            <!-- 手游金币下架 -->
            <a class="f30 color-666 border" @click="isOnline(v.goodsEO.goodsId)"
               v-if="params.status == 1 && v.goodsEO.goodsType === 3 && v.goodsEO.gameType === 2">下架</a>


            <!--装备编辑跳转-->
            <a class="f30 color-666 border" @click="goToEquios(v.goodsEO)"
               v-if="params.status == 1 && v.goodsEO.goodsType === 1">编辑</a>


            <a class="f30 color-666 border" @click="isOnline(v.goodsEO.goodsId)"
               v-if="params.status == 1 && v.goodsEO.isOnline && v.goodsEO.goodsType === 2">下架</a>
            <!--账号pc账号编辑-->
            <!--  <router-link class="f30 color-666 border" v-if="params.status == 2 && v.goodsEO.gameType !== 2
             && v.goodsEO.goodsType === 2" @click.native="saveSrollTop()"
             :to="{name:'goodsCreated',
             query:{goodsId:v.goodsEO.goodsId,game_id:v.goodsEO.gameId,isquick:false,game_name:v.goodsEO.gameName,operation:2}}">
             编辑上架</router-link> -->
            <!--账号手游账号编辑-->
           <!--  <router-link class="f30 color-666 border" v-if="params.status == 2 && v.goodsEO.goodsType === 2 && v.goodsEO.gameType === 2"
                         @click.native="saveSrollTop()"
                         :to="{name:'GoodsCreatedMobile',
                    query:{goodsId:v.goodsEO.goodsId,game_id:v.goodsEO.gameId,isquick:false,game_name:v.goodsEO.gameName,chooseOperatorId:v.goodsEO.serviceProviderId,chooseOperator:v.goodsEO.serviceProviderName,operation:2,game_type:v.goodsEO.gameType}}">
              编辑上架
            </router-link> -->
            <!-- -->
            <a class="f30 color-666 border" @click="deleteGoods(v.goodsEO.goodsId)"
               v-if="params.status == 2 && v.goodsEO.goodsType == 2">删除</a>


            <!--端游金币删除-->
            <a class="f30 color-666 border" @click="deleteGoods(v.goodsEO.goodsId)"
               v-if="params.status == 1 && v.goodsEO.goodsType === 3 && v.goodsEO.gameType === 1">删除</a>

            <!--装备删除-->
            <a class="f30 color-666 border" @click="deleteGoods(v.goodsEO.goodsId)"
               v-if="(params.status == 1 || params.status == 0) && v.goodsEO.goodsType == 1">删除</a>

            <a class="f30 color-666 border" @click="payDeposit(v.goodsEO.goodsId)"
               v-if="params.status == 0 && v.goodsEO.goodsType == 1  && v.goodsEO.payStatus === 1">去支付</a>
          </div>
                  <div v-if="v.goodsEO.auditorStatus == 0 || v.goodsEO.auditorStatus == 1"  class="fw px-30 notice_risk"><i class="icon_notice fl"></i><p class="f24 notice_wz">出售商品无需扫码，切勿私下交易！</p></div>
        </div>
          <div v-else>
          <div class="manage-caption px-30  bg-fff">
            <div class="manage-titl py-30 f28">
            <span class=" fl mr-30 fontbold">
                {{v.BizOfferName}}
            </span>
            </div>
            <a @click="goDetail(v,params.status)">
              <div class="manage-contn bg-faf">
                <div class="mancon-img fl">
                  <i class="f22 color-fff bg-000">
                    {{v.BizOfferTypeName}}
                  </i>
                  <span class="middle"></span>
                  <img src="~images/default_img.jpg" >
                </div>
                <div class="mancon-tn py-15">
                  <div class="tn-hxtxt f26 color-666">
                    {{v.GameName}}/{{v.GameAreaName}}/{{v.GameServerName}}
                  </div>
                  <div class="tn-hxtxt f26 color-666">商品价格：{{v.Price}}元</div>
                  <div class="tn-hxtxt f26 color-666" v-if="v.PublishStatus !=0 && v.BizOfferTypeName =='游戏帐号' ">发布时间：{{v.CreatedDate | formatNew}}</div>
                  <div class="tn-hxtxt f26 color-666" v-if="v.PublishStatus !=0 && v.BizOfferTypeName !='游戏帐号' ">发布时间：{{v.CreatedDate | format}}</div>
                  <div class="tn-hxtxt f26 color-666" v-if="v.PublishStatus ==0 ">发布单号：{{v.BizOfferId}}</div>
                </div>
              </div>
            </a>
          </div>
          <div class="mancon-titl px-30 py-30 bg-fff border-bottom ">
                  <span class="title-curent f30 pl-30 color-000 buyct-why">{{params.status|getStatusText}}
                    <em class="color-m1" v-if="params.status == 0">提交成功，为使帐号尽快出售，5173客服会马上登录您的游戏，进行帐号确认，请您20分钟内不要进游戏</em>
                    <em class="color-m1" v-if="params.status == 2 && v.PublishStatus == 3">下架原因：暂停出售</em>
                    <em class="color-m1" v-if="params.status == 2 && v.PublishStatus == 4"></em>
                    <em class="color-m1" v-else-if="params.status == 2 && v.CancelRemark">{{v.CancelRemark}}</em>
                    </span>
          </div>
          <div class="mancon-btn pr-20 py-20 bg-fff border-bottom " >
             <router-link class="f30 color-666 border" v-if="params.status == 2 && (v.PublishStatus == 2 || v.PublishStatus == 4)"
                         @click.native="saveSrollTop()"
                         :to="{name:'goodsCreated',
                    query:{goodsId:v.BizOfferId,game_id:v.GameId,isquick:false,game_name:v.GameName,chooseOperatorId:v.BizOfferTypeId,chooseOperator:v.GameAreaName,regionId:v.GameAreaId,serverId:v.GameServerId,serverName:v.GameAreaName+'/'+v.GameServerName,operation:1,game_type:2}}">
              编辑上架
            </router-link>

            <a class="f30 color-666 border" v-if="v.PublishStatus == 1 && v.SalableQuantity > 0" @click="bizofferPrice(v.BizOfferId)">修改价格</a>
            <a class="f30 color-666 border" v-if="v.PublishStatus == 3 " @click="bizofferupdate(v.BizOfferId,1)">上架</a>
            <!--<a class="f30 color-666 border" v-if="v.PublishStatus == 1 && v.SalableQuantity > 0" @click="bizofferupdate(v.BizOfferId,2)">暂停出售</a>-->

            <a class="f30 color-666 border" v-if="v.PublishStatus == 1 && v.SalableQuantity > 0"  @click="bizofferupdate(v.BizOfferId,3)">下架</a>
          </div>
          <div  class="fw px-30 notice_risk" v-if="params.status != 2 && (v.PublishStatus != 2 || v.PublishStatus != 4) && params.status != 4"><i class="icon_notice fl"></i><p class="f24 notice_wz">出售商品无需扫码，切勿私下交易！</p></div>
        </div>

      </div>

        <!-- <div class="sellnage-connt mb-20" v-for="v in mobilePcList" >

        </div> -->
    </div>
    </div>
    <shareComponent v-show="shareStatus" :shareUrl='sharemsg'></shareComponent>

    <div class="mint-msgbox-wrapper" style="position: absolute; z-index: 65;" v-show='priceEdit'>
      <div class="mint-msgbox" >
        <div class="mint-msgbox-content">
          <div class="mint-msgbox-message">修改价格</div>
          <div class="mint-msgbox-input">
            <input placeholder="请输入价格" type="text" maxlength="8" v-model="price" @input="Replace()">
          </div>
        </div>
        <div class="mint-msgbox-btns">
          <button class="mint-msgbox-btn mint-msgbox-cancel" @click="bizofferPriceUpdate(false)">取消</button>
          <button class="mint-msgbox-btn mint-msgbox-confirm" @click="bizofferPriceUpdate(true)">确定</button>
        </div>
      </div>
    </div>
    <div class="v-modal" style="z-index: 64;" v-show='priceEdit'></div>
    <div class="loading" v-show="loading">加载中...</div>
    <div class="list-empty bg-fff" v-show="mobileList.length===0 && !loading">
      <p><img src="~images/gamelogo.png"></p>
      <span>您还没有商品</span>
    </div>
  </div>
</template>
<script>
  import {formatTimeFilter} from 'components/common/filters';
  import {formatTimeFilterNew} from 'components/common/filters';
  import {mapState, mapGetters, mapActions} from 'vuex';
  import api from '../../../../api';
  import shareComponent from 'components/common/NewShare.vue';
  import errorImgName from 'images/default_img.jpg'
  export default {
    data() {
      return {
        errorImg:'this.src="' + errorImgName + '"',
        params: {
          pageIndex: 1,
          pageSize: 5,
          status: this.$route.query.status,
          clientType:2,
          tradingServiceType:5,
          publishStatus:this.$route.query.status,
        },
        scrollTop: 0,
        shareStatus: false,
        sharemsg: '',
        loading: false,
        orderText:'',
        priceEdit:false,
        price:'',
        bizOfferId:''
      }
    },
    beforeRouteEnter(to, from, next) {
      let vm = this;
      if ((from.name === 'EditAccountGoods'
          || from.name === 'accountDetail' || from.name === 'MGAccountDetail' || from.name === 'MGAccountDetailNew' || from.name === 'MGCoinDetail'
          || from.name === 'goodsCreated' ||
          from.name === 'GoodsCreatedMobile' || from.name === 'CreatedGold')) {
        next(vm => {
          if (!vm.isUpdate && vm.mobileList.length > 0) {
            vm.params.status = vm.publicState.status;
            console.log(vm.allLoadedPages)
            vm.params.pageIndex =  vm.allLoadedPages
          } else {
            if (vm.isUpdate) {
              vm.params.status = 0;
            } else {
              vm.params.status = vm.$route.query.status;
            }
            vm.initParams();
            vm.getList();
          }
        });
      } else {
        next((vm) => {
          vm.initParams();
          vm.getList();
        });
      }
    },
    components: {
      shareComponent
    },
    computed: {
      ...mapState({
        mobileList: state => {
          return state.memberSeller.mobileList;
        },
        allLoaded: state => {
          return state.memberSeller.allLoaded;
        },
        bizofferLoaded: state => {
          return state.memberSeller.bizofferLoaded;
        },
        publicState: state => {
          return state.memberSeller.publicState;
        },
        isUpdate: state => {
          return state.memberSeller.isUpdate;
        },
        allLoadedPages: state => {
            return state.memberSeller.allLoadedPages;
        }
        // mobilePcList: state => {
        //   return state.memberSeller.mobilePcList;
        // }
      })
    },
    watch: {
      scrollTop(val, oldVal) {
        var vm = this;
        if (vm.$isBottom(200) && (!vm.allLoaded)) {
          ++vm.params.pageIndex;
          // ++vm.pcParams.pageIndex;
          vm.getList();
        }
      }
    },
    created: function () {
      let vm = this;
      //vm.$bus.emit('headerText','手机端发布的商品');
      vm.$nextTick(() => {
        document.body.scrollTop = vm.publicState.scrollTop;
        document.documentElement.scrollTop = vm.publicState.scrollTop
      })
    },
    mounted: function () {
      let vm = this;
      vm.watchGoTop();
      vm.$bus.emit('headerText', '手机端发布的商品');
      vm.$bus.emit('isBack', false);
      vm.$bus.emit('callback', () => {
        vm.$router.push({name: 'MemberSeller'});
      });
      vm.$bus.emit('isMore', true);
    },
    methods: {
      goToDetail(v) {
        let vm = this;
        vm.saveSrollTop();
        if (v.goodsType === 1) {

        }
        if (v.goodsType === 2) { // 装备
          if (v.gameType === 2) { // 手游
            vm.$router.push(
              {
                name: 'MGAccountDetail',
                params: {goodsId: v.goodsId, goods_source_type: 0}
              })
          } else {
            vm.$router.push(
              {
                name: 'accountDetail',
                params: {goodsId: v.goodsId, goods_source_type: 0, gameType: v.gameType}
              })
          }

        }
        if (v.goodsType === 3) { // 金币
          if (v.gameType === 2) { // 手游
            vm.$router.push(
              {name: 'MGCoinDetail', params: {goodsId: v.goodsId}, query: {gameName: v.gameName, gameId: v.gameId}}
            )
          }
        }
      },
      goDetail(v,status){
        this.saveSrollTop()
        this.$router.push(
          {
            name: 'accountDetail',
            params: {goodsId: v.BizOfferId, goods_source_type: 1, gameType: 1}
          })
      },
      payDeposit(id) {
        let vm = this;
        window.location.href = `/publish/publish-deposit.html?goodsId=${id}`;
      },
      watchGoTop: function () {
        var vm = this;
        window.addEventListener('scroll', function () {
          vm.scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
        });
      },
      goToConins(v) {
        let vm = this;
        vm.saveSrollTop();
        if (v.gameType === 2) { // 手游金币编辑
          vm.$router.push({
            name: 'MGSellSetMessageCoin',
            query: {
              edit: true,
              goodsId: v.goodsId
            }
          })
        } else
          vm.$router.push(
            {
              name: 'CreatedGold', query: {
              goodsId: v.goodsId,
              game_type: v.gameType,
              game_id: v.gameId,
              mainGid: v.mainGid,
              chooseOperatorId: v.serviceProviderId,
              game_name: v.gameName,
              chooseOperator: v.serviceProviderName
            }
            })
        // window.location.href = `/member/member-seller-gold-edit.html?goodsId=${v.goodsId}&gameId=${v.gameId}&raceId=&regionId=${v.regionId}&serverId=${v.serverId}&goodsType=${v.goodsType}`;

      },
      goToEquios(v) {
        let vm = this;

        window.location.href = `/member/member-seller-equipment-edit.html?goodsId=${v.goodsId}&gameId=${v.gameId}&raceId=&regionId=${v.regionId}&serverId=${v.serverId}&goodsType=${v.goodsType}`;
      },
      shareClick(v) {
        let title = v.goodsEO.propertyValuesTitle || v.goodsEO.title;
        let url = '';
        if (v.goodsEO.gameType === 2) { // 手游
          url = `${title} ${window.location.origin}/vue/mobile-game/account-detail/${v.goodsEO.goodsId}/0`;
        } else {
          url = `${title} ${window.location.origin}/vue/account/accountDetail/${v.goodsEO.goodsId}/0/${v.goodsEO.gameType}`;
        }

        this.sharemsg = url;
        this.$bus.emit('busShareQZone', {
          title: v.goodsEO.title,
          url: encodeURIComponent(url),
          summary: v.goodsEO.title
        })
        this.shareStatus = true
        this.$bus.emit('shareShow', this.shareStatus)
        this.$bus.emit('busShareUrl', url)

      },
      saveSrollTop: function () {
        let vm = this;
        let params = {
          scrollTop: vm.scrollTop,
          status: vm.params.status
        }
        vm.setPublicState(params);
        vm.setUpdateStatus(false);
      },
      initParams() {
        this.params.pageIndex = 1;
        // this.pcParams.pageIndex = 1;
        this.clearMobilelist();
      },
      selectStatus: function (val) {
        let vm = this;
        this.$router.replace({ // 伪跳转，只改变当路径，页面不刷新，数据也不会被初始化
          path: '/vue/memberseller/sellergoodsListofMobile',
          query: {
            operator: this.$route.query.operator,
            status: val
          }
        })
        vm.params.status = val;
        vm.params.publishStatus = val;
        //设置为初始值
        vm.initParams();
        vm.getList();
      },
      deleteGoods(id) {
        let vm = this;
        let params = {
          goodsId: id
        }
        vm.$messagebox.confirm('确定要删除吗?').then((action) => {
          api.memberSeller.deleteMoblieGoods(params)
          .then((res) => {
            if (res.data.success) {
              vm.$toast('删除成功');
              vm.initParams();
              vm.getList();
            }else{
              vm.$toast(res.data.responseStatus.message);
            }
          })
        })

      },
      bizofferupdate:function(bizOfferId,operate){
        let vm = this,tip='';
        let params = {bizOfferId,operate}
        switch(operate){
        case 1:
          tip = '上架?';
          break;
        case 2:
          tip = '暂停出售?<br/>(暂停出售商品存放在已下架中)'
          break;
        case 3:
          tip = '下架?'
          break;
        }
        vm.$messagebox.confirm('确定要'+tip).then((action) => {
          api.memberSeller.bizofferUpdate(params)
          .then((res) => {
            if (res.data.success) {
              vm.$toast('操作成功');
              vm.initParams();
              vm.getList();
            }else{
              vm.$toast(res.data.responseStatus.message);
            }
          })
        })
      },
      bizofferPrice:function(bizOfferId){
        let vm = this;
        vm.priceEdit = true;
        vm.bizOfferId = bizOfferId;
      },
      bizofferPriceUpdate:function(a){
        let vm = this
        if(a){
          let params = {bizOfferId:vm.bizOfferId,price:vm.price};
          api.memberSeller.changeidbizofferprice(params)
            .then((res) => {
              if (res.data.success) {
                vm.$toast('修改价格成功');
                vm.price = '';
                vm.priceEdit = false;
                vm.initParams();
                vm.getList();
              }else{
                vm.$toast(res.data.responseStatus.message);
              }
            })
          }else{
            vm.priceEdit = false;
            vm.price = "";
          }

      },
      Replace(){
          let vm = this;
          vm.price = vm.price.replace(/[^\d.]/g, "").
          //只允许一个小数点
          replace(/^\./g, "").replace(/\.{2,}/g, ".").
          //只能输入小数点后两位
          replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');

      },
      isOnline: function (goodsId) {
        let vm = this;
        let params = {
          goodsId: goodsId,
          isOnline: false
        }
        vm.$messagebox.confirm('确定要下架吗?')
        .then((action) => {
          api.memberSeller.online(params)
          .then((res) => {
            if (res.data.success) {
              vm.$toast('下架成功');
              vm.initParams();
              vm.getList();
            } else {
              vm.$toast(res.data.responseStatus.message);
            }
          })
        });
      },
      async getList() {
        this.loading = true;
        await this.getMobileList(this.params)
        .then((res) => {

        });
        // await this.getmobilepcList(this.pcParams)
        // .then((res) => {
        // });

        this.loading = false;
      },
      ...mapActions({
        getMobileList: 'member/MEMBER_SELLER_MOBILE_LIST',
        clearMobilelist: 'member/MEMBER_SELLER_CLEAR_MOBILELIST',
        setPublicState: 'member/MEMBER_SELLER_GOODS_MOBILE_PUBLICSTATE',
        setUpdateStatus: 'member/MEMBER_SELLER_GOODS_UPDATE_STATUS',
        // getmobilepcList:'member/MEMBER_SELLER_MOBILEPC_LIST',
      })
    },
    filters: {
      getGoodsTypeText(val) {
                 return val  === 1 ?'游戏装备':val === 2 ? '游戏帐号' : val === 3 ?'游戏币':'游戏帐号';
      },
      format: formatTimeFilter,
      formatNew:formatTimeFilterNew,
      getStatusText: function (val) {
        let text = '';
        if (val == 0) {
          text = '商品审核中';
        } else if (val == 1) {
          text = '商品已上架出售';
        } else if (val == 2 || val == 3) {
          text = '商品已下架';
        } else if (val == 4) {
          text = '商品已售出';
        }

        return text;
      },
      getReason: function (value, status, v) {
        let vm = this;
        let text = '';

        if (v.goodsType != 2 && v.goodsType !== 3) {
          return;
        }
        if (status == 0) {
          text = '提交成功，为使帐号尽快出售，5173客服会马上登录您的游戏，进行帐号确认，请您20分钟内不要进游戏';
        }
        if (status == 1 && !v.isOnline) {
          text = '商品已有买家购买，目前正在交易中';
        }
        if (status == 2) {
          switch (v.auditorReason) {
            case 1:
              text = '帐号密码错误'
              break;
            case 2:
              text = '标题带联系方式或者违规字眼';
              break;
            case 3:
              text = '图片违规或者带有联系方式';
              break;
            case 4:
              text = v.auditorOtherReason;
              if(v.gameType === 2 && v.goodsType === 3) { // 孙小晨说手游金币下架的提示改成这样
                return '原因:' + text;
              }
              return '审核失败，原因:' + text;
          }
        }
        return text;
      }
    }
  }
</script>
<style src="css/common/member-cxy.css" ></style>

<style scoped>
  .fixedFill-mx {
    width: 100%;
    height: .96rem;
  }

  .loading {
    text-align: left;
    text-indent: .6rem;
    line-height: .5rem;
    height: .5rem;
    background: url('~images/loading.gif') left center no-repeat;
    background-size: .5rem;
    margin-top: -.1rem;
    margin-left: 2.5rem;
  }

  .ml8 {
    margin-left: 8px;
  }
  .mint-msgbox-input input {
  border: 1px solid #dedede;
  padding: 4px 5px;
  width: 100%;
  }
  /*  .sellnage-nav{
            position: fixed;
    width: 100%;
    z-index: 99;
    }*/

    /* 风控警告提示 */
/* .notice_top{position:absolute;margin-top: 0.3rem;top:0rem;} */
.notice_risk{height: auto;display: block;overflow: hidden;background-color: #fffdf4;}
.notice_risk .icon_notice{background: url('~images/seller/notice_no.png') center center no-repeat;width:.3rem;height:.78rem;line-height:.78rem;background-size:.3rem;display:inline-block;margin-right:.1rem;}
.notice_risk .notice_wz{line-height: .38rem;padding: .2rem 0rem .2rem 0rem;color: #be8600;}
.notice_risk .notice_public{padding:.2rem 0 .2rem 0;width:95%;}
.notice_risk .notice_public p{height:.35rem;line-height:.35rem;color: #be8600;overflow:hidden;}
</style>
